<?php

use app\common\controller\Home;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//引入控制器
use App\Http\Controllers\HomeController;

//默认首页
// typeid 可以有也可以没有  where 针对路由参数的条件
Route::get('/{typeid?}', [HomeController::class, 'index'])->where('typeid','[0-9]+');

//添加路由
Route::get('/info/{artid}', [HomeController::class, 'info']);

Route::post('/comment/{artid}',[HomeController::class, 'comment']);

Route::get('/type', [HomeController::class, 'type']);



//提醒跳转
Route::any('/success', [HomeController::class, 'success'])->name('success');
Route::any('/error', [HomeController::class, 'error'])->name('error');
